﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using LinQ_DTO;
namespace BUS
{
    public class Sanpham_khuyenmaiBUS
    {
        public List<shop_sanpham_khuyenmai> LayTatCaCacSanPham_KhuyenMai()
        {
            Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
            return sp_kmDAO.LayTatCaCacSanPham_KhuyenMai();
        }

         public List<shop_sanpham> LayTatCaSanPhamTheoMakhuyenMai(int MaKM)
        {
            Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
            return sp_kmDAO.LayTatCaSanPhamTheoMakhuyenMai(MaKM);
        }

         public List<shop_khuyenmai> LayKhuyenMaiTheoMaSanPham(int MaSP)
         {
             Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
             return sp_kmDAO.LayKhuyenMaiTheoMaSanPham(MaSP);
         }

         public void ThemSanPham_KhuyenMai (shop_sanpham_khuyenmai sp_km)
         {
             Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
             sp_kmDAO.ThemSanPham_KhuyenMai(sp_km);
         }

         public void XoaSanPham_KhuyenMaiTheoMaSP(int MaSP)
         {
             Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
             sp_kmDAO.XoaSanPham_KhuyenMaiTheoMaSP(MaSP);
         }

         public void XoaSanPham_KhuyenMaiTheoMaKM(int MaKM)
         {
             Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
             sp_kmDAO.XoaSanPham_KhuyenMaiTheoMaKM(MaKM);
         }

         public void CapNhatSanPham_KhuyenMai(int MaSP, int MaKMCu, int MaKMMoi)
         {
             Sanpham_khuyenmaiDAO sp_kmDAO = new Sanpham_khuyenmaiDAO();
             sp_kmDAO.CapNhatSanPham_KhuyenMai(MaSP, MaKMCu, MaKMMoi);
         }
    }
}
